/*
 * Copyright (c) 2013 WDCY Information Technology Co. Ltd
 * www.wdcy.cc
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * WDCY Information Technology Co. Ltd ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement you
 * entered into with WDCY Information Technology Co. Ltd.
 */
package com.monkey.web.dto.response.monitor;


import com.monkey.core.web.response.MonkeyResponseDto;
import com.monkey.utils.PrettyMemoryUtils;

import java.lang.management.ManagementFactory;
import java.lang.management.MemoryUsage;

/**
 * @author Wu Tianqiang
 */
public class LoadMemoryInfoResponseJSONDto extends MonkeyResponseDto {
    private String initMemory;
    private String maxMemory;
    private String usedMemory;

    public LoadMemoryInfoResponseJSONDto() {
        MemoryUsage heapMemoryUsage = ManagementFactory.getMemoryMXBean().getHeapMemoryUsage();
        this.initMemory = PrettyMemoryUtils.prettyByteSize(heapMemoryUsage.getInit());
        this.maxMemory = PrettyMemoryUtils.prettyByteSize(heapMemoryUsage.getMax());
        this.usedMemory = PrettyMemoryUtils.prettyByteSize(heapMemoryUsage.getUsed());
    }

    public String getInitMemory() {
        return initMemory;
    }

    public void setInitMemory(String initMemory) {
        this.initMemory = initMemory;
    }

    public String getMaxMemory() {
        return maxMemory;
    }

    public void setMaxMemory(String maxMemory) {
        this.maxMemory = maxMemory;
    }

    public String getUsedMemory() {
        return usedMemory;
    }

    public void setUsedMemory(String usedMemory) {
        this.usedMemory = usedMemory;
    }
}